# This is a basic playbook

- name: dole out the generic configuration
  hosts: data-analysis01.phx2.fedoraproject.org
  user: root
  gather_facts: True

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  pre_tasks:
  - import_tasks: "{{ tasks_path }}/yumrepos.yml"

  roles:
  - base
  - rkhunter
  - hosts
  - fas_client
  - nagios_client
  - collectd/base
  - sudo
  - role: keytab/service
    owner_user: apache
    owner_group: apache
    service: HTTP
    host: "data-analysis.fedoraproject.org"
    when: env == "production"
  - awstats
  - web-data-analysis

  tasks:
  - import_tasks: "{{ tasks_path }}/2fa_client.yml"
  - import_tasks: "{{ tasks_path }}/motd.yml"

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"

- name: dole out the service-specific config
  hosts: data-analysis01.phx2.fedoraproject.org
  user: root
  gather_facts: True
  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"

  roles:
   - role: nfs/client
     mnt_dir: '/mnt/fedora_stats'
     nfs_mount_opts: "rw,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3"
     nfs_src_dir: 'fedora_stats'
   - geoip

  tasks:
   - name: install needed packages
     package: name={{ item }} state=present
     with_items:
       - httpd
       - httpd-tools
       - mod_ssl
       - rsync
       - openssh-clients
       - emacs-nox
       - emacs-git
       - git
       - bc
       - python-geoip-geolite2
       - php-pdo
       - php-gd
       - php-xml
       - php-mbstring
       - php
       - php-pecl-geoip
       - gnuplot
       - htmldoc
       - mod_auth_gssapi


##
